<?php
$_id = $data->create_user_id;
$model = UserProfiles::model()->findbyPk($_id);
?>
<div class="comment comment-box">
        <div class="comment-title">
           <div class="comment-avatar border-shadow"><img src="<?php if($model!=null AND $model->avatar!=null){ ?>  <?php echo Yii::app()->request->baseUrl;?>/data/<?php echo $model->avatar;} else echo Yii::app()->request->baseUrl."/images/noavatar.gif"; ?>" height="80px" width="80px" /></div>
            <div class="comment-owner"><span>
            <?php 
				if($model != null)
					echo CHtml::link(CHtml::encode($model->display_name), array('users/viewprofiles', 'id'=>Yii::app()->user->id));
				else
					echo CHtml::link($data->createUser->username, array('users/viewprofiles', 'id'=>$data->create_user_id));
			?>
            </span></div>
            <div class="comment-time">Create on <span><?php echo date ('F j, Y \a\t h:i:s a',strtotime($data->create_time));?></span><br />Said that:</div>
            <div class="clear"></div>
        </div>
        <div class="comment-detail"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/comment-title.png" width="72px" height="10px" /></div>
        <div class="comment-content border-line border-round border-shadow">
        <?php echo nl2br(CHtml::encode($data->content));?>
        </div>
        <br />
    </div>